//
//  GroupListCtr.swift
//  eemall
//
//  Created by zhuxietong on 2019/1/8.
//  Copyright © 2019 tianrun. All rights reserved.
//

import Foundation
import UIKit
import Foundation
import soapp
import AsyncDisplayKit
import Eelay

open class GroupListCtr:ASCollectionContainer{
    var goodsID:String{
        get{
            return mo.model["goodsid",""]
        }
    }
    
    open override func viewDidLoad() {
        self.page_load_section = "section0"
        self.content = ASTermsContainer.list(
            net: JoTask()._surl(.正在拼团列表).log.log_response().post,
            node: "list",
            emptyMsg: "没有相关内容".loc,
            params: ["goodsid":goodsID],
            cellType: GroupCell.self,
            detailType:nil,
            test: false
        )
        
        super.viewDidLoad()
        self.title = "正在拼团中".loc
        collectionNode.backgroundColor = UIColor._background
        reload_page()
        
    }
    
    open override func loadOnePage(list: [Any]) -> [Any] {
        return super.loadOnePage(list: list)
    }
    
    class GroupCell: GroupGoodsDetailCtr.GroupCell {
        override func mo_model_reload() {
            super.mo_model_reload()
            separatorHeight = TP.separatorHeight
            separatorColor = ._separator
        }
        @objc override func joinAction() {
            GroupActive.seeGroup(obj: mo.model, at: mo.controller)
        }
    }
}
